if(self.parent.frames.length!=0){
	self.parent.location=document.location.href;
}

/*
 $ Ajax登陆Login()
 */
function Logining(){
	var msg="";
	var obj=document.getElementById("showmsg");
	var remuser=document.getElementById("remuser").checked;
	var username=$.trim(document.getElementById("username").value);
	document.getElementById("username").value = username;
	var password=document.getElementById("password").value;
	var checkcode_value=document.getElementById("checkcode_value").value;
	var checkcode_name=document.getElementById("checkcode_name").value;
	var check=true;
	if(sl(checkcode_value)<1){check=false;document.getElementById("checkcode_value").focus();}
	if(sl(password)<1){check=false;document.getElementById("password").focus();}
	if(sl(username)<1){check=false;document.getElementById("username").focus();}
	
	if(remuser==true&&sl(username)>1){
		KnifeCMS.Cookie.SetCookie("rememberUser",username,1000*60*60*24*365);
	}else{
		KnifeCMS.Cookie.SetCookie("rememberUser","",1000*60*60*24*365);
	}
	if(check){
		obj.innerHTML="";
		var LoadingBar=document.createElement("div");//创建一个加载进度条
		LoadingBar.className="loading_big";
		LoadingBar.id="ImgLoading";
		LoadingBar.innerHTML='logining....';
		obj.appendChild(LoadingBar);
		username=escape(username);
		password=escape(password);
		var ajaxString = "username="+username+"&password="+password+"&checkcode_name="+checkcode_name+"&checkcode_value="+checkcode_value;
		var ajaxUrl    = "ajax.login.asp?ctl=sysuserlogin&act=login";
		var ajaxSta    = posthttp(ajaxString,ajaxUrl);//window.open(ajaxUrl);
		//alert(ajaxSta);
		if(ajaxSta=="ok"){
			window.location.href="index.asp?ctl=systemindex&act=view";
		}else if(ajaxSta=="error_checkcode"){
			KnifeCMS.GetCodeImg("../");
			obj.innerHTML="验证码错误!<br><span>checkcode is wrong!<span>";
		}else{
			KnifeCMS.GetCodeImg("../");
			obj.innerHTML="登陆失败，管理员帐号或密码错误！<br><span>admin or password is wrong!<span>";
		}
	}else{
		obj.innerHTML=msg;
	}
}
function browserTip(){
	var $browser = navigator.userAgent.toLowerCase();
	if(/msie 5.5/i.test($browser) || /msie 6.0/i.test($browser) || /msie 7.0/.test($browser)){
		$("div.login").hide();
		$("div.ie6-tip").show();
	}
	
	//$("#browsertip").html('<div class="browsertip">您当前使用的是ie核心系列的浏览器，为获得最佳使用体验，我们(KnifeCMS开发团队)建议您使用<a href="http://firefox.com.cn/download/" target="_blank">Firefox</a> 或 <a href="https://www.google.com/intl/zh-CN/chrome/browser/" target="_blank">Google Chrome</a>浏览器来进行后台管理。<a class="close" href="javascript:browserTipClose();">X</a></div>');
}
function browserTipClose(){
	KnifeCMS.$id("browsertip").style.display="none";
}